﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml.Serialization;


namespace LyncServerExtension.Plugin.Snom
{
    public class SnomIPPhoneText : ILyncResult
    {
        public string Title { get; set; }
        public string Prompt { get; set; }
        public string Text { get; set; }
        public SnomIPPhoneTextLed Led { get; set; }

        public string MimeType
        {
            get { return "text/xml"; }
        }

        public void Write(System.IO.Stream stream)
        {
            new XmlSerializer(typeof(SnomIPPhoneText)).Serialize(stream, this);
        }
    }

    public class SnomIPPhoneTextLed : IXmlSerializable
    {
        public int Number { get; set; }
        public bool IsEnabled { get; set; }

        public System.Xml.Schema.XmlSchema GetSchema()
        {
            return null;
        }

        public void ReadXml(System.Xml.XmlReader reader)
        {
        }

        public void WriteXml(System.Xml.XmlWriter writer)
        {
            writer.WriteAttributeString("number", Number.ToString());
            writer.WriteString(IsEnabled ? "on" : "off");
        }
    }
}
